home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / HyperCard / Resource Library / Resource Library / background_9564.txt < prev    next >
Text File  |  1989-05-28  |  10KB  |  475 lines

  1. -- background: 9564 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: Cursors
  6. ----- HyperTalk script -----
  7. on openCard
  8.   if fld curButton <> "" then
  9.     set the highlight of card button id (background field curButton) to false
  10.     put "" into fld curButton
  11.   end if
  12. end openCard
  13.  
  14. on AddNewCard name
  15.   global buttonId
  16.  
  17.   set lockscreen to true
  18.  
  19.   put background field "Number" into ix
  20.   if ix = 20 then
  21.     doMenu "New Card"
  22.     put 0 into background field "Number"
  23.     put "" into background field "curButton"
  24.     put "CURS" into background field "resType"
  25.   end if
  26.  
  27.   makeButton
  28.  
  29.   put "set name of button id" && buttonId && "to" && quote & name & quote into tmp
  30.   do tmp
  31.  
  32.   set lockscreen to false
  33.  
  34. end AddNewCard
  35.  
  36. function buttonRect num
  37. put 30 + (num div 5) * 70 into tv
  38. put 75 + (num mod 5) * 70 into th
  39.  
  40. return th & "," & tv & "," & th+60 & "," & tv+60
  41. end buttonRect
  42.  
  43. on makeButton
  44.   global buttonId
  45.   put background field "Number" into ix
  46.   put ix+1 into background field "Number"
  47.  
  48.   set visible of background button "protoButton" to true
  49.  
  50.   choose button tool
  51.   click at loc of background button "protoButton"
  52.   doMenu "Copy Button"
  53.   doMenu "Paste Button"
  54.   choose browse tool
  55.  
  56.   set visible of background button "protoButton" to false
  57.  
  58.   set the rect of last button to buttonRect(ix)
  59.   put the id of last button into buttonId
  60.  
  61. end makeButton
  62.  
  63. on showCursor curs
  64.   set the cursor to the short name of the target
  65.   put the rect of the target into tmp
  66.   put item 1 of tmp into th
  67.   put item 2 of tmp into tv
  68.   put item 3 of tmp into bh
  69.   put item 4 of tmp into bv
  70.   repeat
  71.     put the mouseH into h
  72.     put the mouseV into v
  73.     if (h < th) or (h >bh) or (v < tv) or (v >bv) then
  74.       exit repeat
  75.     else
  76.       if the mouse is down then
  77.         wait until the mouse is up
  78.         put the mouseH into h
  79.         put the mouseV into v
  80.         if (h < th) or (h >bh) or (v < tv) or (v >bv) then
  81.           exit repeat
  82.         else
  83.           buttonHit
  84.         end if
  85.       end if
  86.     end if
  87.   end repeat
  88. end showCursor
  89.  
  90. on hideFields
  91.   set visible of background field "Number" to false
  92.   set visible of background field "curButton" to false
  93.   set visible of background button "protoButton" to false
  94. end hideFields
  95.  
  96. on showFields
  97.   set visible of background field "Number" to true
  98.   set visible of background field "curButton" to true
  99.   set visible of background button "protoButton" to true
  100. end showFields
  101.  
  102.  
  103.  
  104. -- part 1 (button)
  105. -- low flags: 80
  106. -- high flags: 0001
  107. -- rect: left=7 top=304 right=335 bottom=35
  108. -- title width / last selected line: 0
  109. -- icon id / first selected line: 3835 / 3835
  110. -- text alignment: 1
  111. -- font id: 0
  112. -- text size: 12
  113. -- style flags: 0
  114. -- line height: 16
  115. -- part name: Prev
  116. ----- HyperTalk script -----
  117. on mouseUp
  118.   go to previous card of this background
  119. end mouseUp
  120.  
  121.  
  122.  
  123. -- part 2 (button)
  124. -- low flags: 80
  125. -- high flags: 0001
  126. -- rect: left=476 top=305 right=336 bottom=504
  127. -- title width / last selected line: 0
  128. -- icon id / first selected line: 29484 / 29484
  129. -- text alignment: 1
  130. -- font id: 0
  131. -- text size: 12
  132. -- style flags: 0
  133. -- line height: 16
  134. -- part name: Next
  135. ----- HyperTalk script -----
  136. on mouseUp
  137.   go to next card of this background
  138. end mouseUp
  139.  
  140.  
  141.  
  142. -- part 3 (button)
  143. -- low flags: 00
  144. -- high flags: 0001
  145. -- rect: left=475 top=26 right=59 bottom=504
  146. -- title width / last selected line: 0
  147. -- icon id / first selected line: 21700 / 21700
  148. -- text alignment: 1
  149. -- font id: 0
  150. -- text size: 12
  151. -- style flags: 0
  152. -- line height: 16
  153. -- part name: Home
  154. ----- HyperTalk script -----
  155. on mouseUp
  156.   go home
  157. end mouseUp
  158.  
  159.  
  160.  
  161. -- part 4 (button)
  162. -- low flags: 00
  163. -- high flags: 0001
  164. -- rect: left=475 top=60 right=93 bottom=504
  165. -- title width / last selected line: 0
  166. -- icon id / first selected line: 24317 / 24317
  167. -- text alignment: 1
  168. -- font id: 0
  169. -- text size: 12
  170. -- style flags: 0
  171. -- line height: 16
  172. -- part name: Welcome
  173. ----- HyperTalk script -----
  174. on mouseUp
  175.   go to card "Welcome"
  176. end mouseUp
  177.  
  178.  
  179.  
  180. -- part 5 (button)
  181. -- low flags: 00
  182. -- high flags: 8003
  183. -- rect: left=423 top=162 right=187 bottom=507
  184. -- title width / last selected line: 0
  185. -- icon id / first selected line: 0 / 0
  186. -- text alignment: 1
  187. -- font id: 0
  188. -- text size: 12
  189. -- style flags: 0
  190. -- line height: 16
  191. -- part name: Functions
  192. ----- HyperTalk script -----
  193. on mouseUp
  194.   go to first card of background "Functions"
  195. end mouseUp
  196.  
  197.  
  198.  
  199. -- part 6 (button)
  200. -- low flags: 00
  201. -- high flags: 8003
  202. -- rect: left=423 top=133 right=158 bottom=507
  203. -- title width / last selected line: 0
  204. -- icon id / first selected line: 0 / 0
  205. -- text alignment: 1
  206. -- font id: 0
  207. -- text size: 12
  208. -- style flags: 0
  209. -- line height: 16
  210. -- part name: Commands
  211. ----- HyperTalk script -----
  212. on mouseUp
  213.   go to first card of background "Commands"
  214. end mouseUp
  215.  
  216.  
  217.  
  218. -- part 7 (button)
  219. -- low flags: 00
  220. -- high flags: 8003
  221. -- rect: left=423 top=220 right=245 bottom=507
  222. -- title width / last selected line: 0
  223. -- icon id / first selected line: 0 / 0
  224. -- text alignment: 1
  225. -- font id: 0
  226. -- text size: 12
  227. -- style flags: 0
  228. -- line height: 16
  229. -- part name: Sounds
  230. ----- HyperTalk script -----
  231. on mouseUp
  232.   go to first card of background "Sounds"
  233. end mouseUp
  234.  
  235.  
  236.  
  237. -- part 8 (button)
  238. -- low flags: 00
  239. -- high flags: 8003
  240. -- rect: left=423 top=249 right=274 bottom=507
  241. -- title width / last selected line: 0
  242. -- icon id / first selected line: 0 / 0
  243. -- text alignment: 1
  244. -- font id: 0
  245. -- text size: 12
  246. -- style flags: 0
  247. -- line height: 16
  248. -- part name: Add
  249. ----- HyperTalk script -----
  250. on mouseUp
  251.   go to card "Add"
  252. end mouseUp
  253.  
  254.  
  255.  
  256. -- part 9 (button)
  257. -- low flags: 80
  258. -- high flags: 8003
  259. -- rect: left=2 top=123 right=145 bottom=102
  260. -- title width / last selected line: 0
  261. -- icon id / first selected line: 0 / 0
  262. -- text alignment: 1
  263. -- font id: 3
  264. -- text size: 9
  265. -- style flags: 0
  266. -- line height: 12
  267. -- part name: protoButton
  268. ----- HyperTalk script -----
  269. on mouseUp
  270.   buttonHit
  271. end mouseUp
  272.  
  273. on mouseEnter
  274.   showCursor
  275. end mouseEnter
  276.  
  277.  
  278. -- part 10 (field)
  279. -- low flags: 00
  280. -- high flags: 0000
  281. -- rect: left=6 top=30 right=53 bottom=58
  282. -- title width / last selected line: 0
  283. -- icon id / first selected line: 0 / 0
  284. -- text alignment: 0
  285. -- font id: 3
  286. -- text size: 14
  287. -- style flags: 256
  288. -- line height: 18
  289. -- part name: resType
  290.  
  291.  
  292. -- part 11 (field)
  293. -- low flags: 80
  294. -- high flags: 0002
  295. -- rect: left=8 top=61 right=80 bottom=48
  296. -- title width / last selected line: 0
  297. -- icon id / first selected line: 0 / 0
  298. -- text alignment: 0
  299. -- font id: 3
  300. -- text size: 12
  301. -- style flags: 0
  302. -- line height: 16
  303. -- part name: Number
  304.  
  305.  
  306. -- part 12 (field)
  307. -- low flags: 80
  308. -- high flags: 0002
  309. -- rect: left=3 top=91 right=112 bottom=87
  310. -- title width / last selected line: 0
  311. -- icon id / first selected line: 0 / 0
  312. -- text alignment: 0
  313. -- font id: 3
  314. -- text size: 12
  315. -- style flags: 0
  316. -- line height: 16
  317. -- part name: curButton
  318.  
  319.  
  320. -- part 14 (button)
  321. -- low flags: 00
  322. -- high flags: 8003
  323. -- rect: left=102 top=306 right=331 bottom=199
  324. -- title width / last selected line: 0
  325. -- icon id / first selected line: 0 / 0
  326. -- text alignment: 1
  327. -- font id: 0
  328. -- text size: 12
  329. -- style flags: 0
  330. -- line height: 16
  331. -- part name: Paste
  332. ----- HyperTalk script -----
  333. on mouseUp
  334.   if background field "curButton" = "" then
  335.     answer "You must select a CURS first!" with "Oops"
  336.     exit mouseUp
  337.   end if
  338.   put background field resType && the short name of card button id (background field "curButton") & return into tmp
  339.   go to card "Paste"
  340.   put tmp after card field "ToPaste"
  341. end mouseUp
  342.  
  343.  
  344.  
  345. -- part 15 (button)
  346. -- low flags: 00
  347. -- high flags: A003
  348. -- rect: left=206 top=306 right=331 bottom=296
  349. -- title width / last selected line: 0
  350. -- icon id / first selected line: 0 / 0
  351. -- text alignment: 1
  352. -- font id: 0
  353. -- text size: 12
  354. -- style flags: 0
  355. -- line height: 16
  356. -- part name: Rename
  357. ----- HyperTalk script -----
  358. on mouseUp
  359.   butRename
  360. end mouseUp
  361.  
  362.  
  363.  
  364. -- part 16 (button)
  365. -- low flags: 00
  366. -- high flags: 8003
  367. -- rect: left=303 top=306 right=331 bottom=397
  368. -- title width / last selected line: 0
  369. -- icon id / first selected line: 0 / 0
  370. -- text alignment: 1
  371. -- font id: 0
  372. -- text size: 12
  373. -- style flags: 0
  374. -- line height: 16
  375. -- part name: Delete
  376. ----- HyperTalk script -----
  377. on mouseUp
  378.   butDelete
  379. end mouseUp
  380.  
  381.  
  382.  
  383. -- part 17 (button)
  384. -- low flags: 00
  385. -- high flags: 8003
  386. -- rect: left=423 top=191 right=216 bottom=507
  387. -- title width / last selected line: 0
  388. -- icon id / first selected line: 0 / 0
  389. -- text alignment: 1
  390. -- font id: 0
  391. -- text size: 12
  392. -- style flags: 0
  393. -- line height: 16
  394. -- part name: Icons
  395. ----- HyperTalk script -----
  396. on mouseUp
  397.   go to first card of background "Icons"
  398. end mouseUp
  399.  
  400.  
  401.  
  402. -- part 18 (button)
  403. -- low flags: 80
  404. -- high flags: 0001
  405. -- rect: left=2 top=256 right=300 bottom=43
  406. -- title width / last selected line: 0
  407. -- icon id / first selected line: 32670 / 32670
  408. -- text alignment: 1
  409. -- font id: 0
  410. -- text size: 12
  411. -- style flags: 0
  412. -- line height: 16
  413. -- part name: Scan
  414. ----- HyperTalk script -----
  415. on mouseUp
  416.   repeat until the mouseClick
  417.     visual effect dissolve
  418.     go to next card of this background
  419.   end repeat
  420. end mouseUp
  421.  
  422.  
  423.  
  424. -- part 20 (button)
  425. -- low flags: 00
  426. -- high flags: 0001
  427. -- rect: left=2 top=210 right=254 bottom=43
  428. -- title width / last selected line: 0
  429. -- icon id / first selected line: 20186 / 20186
  430. -- text alignment: 1
  431. -- font id: 0
  432. -- text size: 12
  433. -- style flags: 0
  434. -- line height: 16
  435. -- part name: Sort
  436. ----- HyperTalk script -----
  437. on mouseUp
  438.   lock screen
  439.   put "" into names
  440.   put the number of cds in this bg into cnum
  441.   repeat for cnum
  442.     set cursor to busy
  443.     repeat with i = 1 to fld "Number"
  444.       put the short name of btn i & return after names
  445.     end repeat
  446.     go next cd of this bg
  447.   end repeat
  448.   put SortLines(names) into names
  449.   put the short name of this bg into back
  450.   repeat for (cnum - 1)
  451.     set cursor to busy
  452.     go last cd of bg back
  453.     doMenu "Delete Card"
  454.   end repeat
  455.   go cd 1 of bg back
  456.   choose button tool
  457.   put fld "Number" into n
  458.   repeat with i = 1 to n
  459.     set cursor to busy
  460.     click at loc of btn (n-i+1)
  461.     doMenu "Clear Button"
  462.   end repeat
  463.   choose browse tool
  464.   put 0 into fld "Number"
  465.   put "" into fld curButton
  466.   repeat with i = 1 to number of lines in names
  467.     set cursor to busy
  468.     AddNewCard (line i of names)
  469.   end repeat
  470.   go cd 1 of this bg
  471.   set cursor to hand
  472.   unlock screen
  473. end mouseUp
  474.  
  475.